
public class ObserverTester {
	//定义广播
	private  Broadcast broadcast; 
	private  Telephone telPhone;
	
	//定义听众
	private  Listener  rcv;
	 //构造函数，注册广播和听众
	public ObserverTester()
	{
	     this.broadcast = new Broadcast("Hi");
	     //this.telPhone = new Telephone("15015910551");
	     // Listener need to be notified to listen to whom!
	     this.rcv = new  Listener(this.broadcast);
	     // Broadcaster need to know whom should broadcast
	     broadcast.addObserver(this.rcv);
	     //telPhone.addObserver(this.rcv);
	}
	
	public static void main(String[] args)
	{
		System.out.println("ddddddddddddddddddddddd");
		ObserverTester  myObserableTest = new ObserverTester();
	    myObserableTest.broadcast.saySomething(" world!");
	    System.out.println("1111111111111111");
	   // myObserableTest.telPhone.setTelNo("13480920060");
	}


}
